package com.example.shopp_2301.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.example.shopp_2301.R
import com.example.shopp_2301.room.Fen

class FenAdapter:BaseQuickAdapter<Fen,BaseViewHolder>(R.layout.item_fen) {
    override fun convert(holder: BaseViewHolder, item: Fen) {
        holder.setText(R.id.tv_id,item.id.toString())
        if(item.type==1){//收入
            holder.setText(R.id.tv_yt,"收入")
            holder.setText(R.id.tv_fen,"+${item.fen}")
        }else{
            holder.setText(R.id.tv_yt,"兑好物")
            holder.setText(R.id.tv_fen,"-${item.fen}")
        }

    }
}